---@class DarkStreetStoneItem : DSActorItem
local DarkStreetStoneItem = Class("DarkStreetStoneItem",DSActorItem)
function DarkStreetStoneItem:OnCreate(obj)
    DSActorItem.OnCreate(self,obj)
    self.name = self:GetChild("Text_StoneName")
    ---@type FairyGUI.GSlider
    self.slider = self:GetChild("Bar_BloodBar")
    self.ctrlType = self:GetController("Type")
end
---@param actor RedRob.Stone
function DarkStreetStoneItem:Refresh(actor)
    if not actor then return end
    self.id = actor:GetId()
    local modelId = actor:GetModelId()
    local cfg = dataTable.getDataTableByStringId("t_darkstreetstone",modelId)
    self.name.text = getLanguage(cfg.f_StoneName)
    self.slider.max = actor.hpMax
    self.slider.value = actor.hp
    self.ctrlType.selectedIndex = cfg.f_type
    local p = actor:GetPos()
    self:SetFollowPos(p.x,p.y)
end
function DarkStreetStoneItem:SetHp(hp,max)
    self.slider.value = hp
end
return DarkStreetStoneItem